NDN provides a data-based architecture, where data is used as an entity on a network, and a “name” is used as a unique identifier of the data. The NDN defines data in two formats: one is data used for sending a request, which may be called an “interest packet”; and the other is data including content, which may be called a “data packet.” Data in each format uses a name as a unique identifier, for example, the name of the interest packet is used to uniquely identify a request of the interest packet for obtaining content, and the name of the data packet is used to uniquely identify content loaded in the data packet.
An NDN system includes a data source and at least one router. The data source may be a database or a server that provides original data, and the router may provide a user with a data transmission service and cache data during a data transmission process. In the NDN system, a request message sent by a requester (for example, a user terminal) initiates a data communication process, where the request message carries an identifier of data that is requested to be obtained, that is, a “name” of the data. An operation of the data communication process is performed based on the “name,” and is irrelevant to an address (for example, an internet protocol (IP) address or a storage address of the data).
In an existing NDN system, a caching policy of each router is generally determined based on time when the data is requested and/or a frequency at which the data is requested. For example, if a piece of data in a local cache of a router is requested at a relatively high frequency or is just requested to be obtained recently, the local cache of the router considers that the data is hot data and sets a relatively long life cycle for the data, so that the data is stored in the local cache for a relatively long time, so as to ensure a hit ratio of the data. However, because factors affecting the caching policies of routers are the same, that is, the time when the data is requested and/or the frequency at which the data is requested, if same data is requested at a same frequency or at the same time in each router, the data has a same life cycle in the local cache of each router, which may cause that the same data in each router is deleted concurrently, thereby affecting data diversity in the NDN system and affecting a data hit ratio in the NDN system.